{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 本代码用来给指定的根据指定的csv文件生成对应的特征列"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. 导入包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np  \n",
    "import pandas as pd\n",
    "import math\n",
    "import os\n",
    "from scipy.fftpack import fft,ifft\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib.axes as axes\n",
    "from tqdm import tqdm\n",
    "from sklearn.decomposition import PCA           #加载PCA算法包\n",
    "import seaborn as sns"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. 加载文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>us</th>\n",
       "      <th>acc</th>\n",
       "      <th>avg32</th>\n",
       "      <th>std32</th>\n",
       "      <th>max32</th>\n",
       "      <th>min32</th>\n",
       "      <th>med32</th>\n",
       "      <th>rms32</th>\n",
       "      <th>engy32</th>\n",
       "      <th>...</th>\n",
       "      <th>min8f</th>\n",
       "      <th>med8f</th>\n",
       "      <th>rms8f</th>\n",
       "      <th>engy8f</th>\n",
       "      <th>skw8f</th>\n",
       "      <th>krt8f</th>\n",
       "      <th>Fskw8f</th>\n",
       "      <th>Fkrt8f</th>\n",
       "      <th>Fmax8f</th>\n",
       "      <th>FmaxId8f</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>52:08.4</td>\n",
       "      <td>1012464</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.001295</td>\n",
       "      <td>...</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.001295</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>52:08.4</td>\n",
       "      <td>1044468</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.03470</td>\n",
       "      <td>0.001280</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.034700</td>\n",
       "      <td>0.034724</td>\n",
       "      <td>0.001206</td>\n",
       "      <td>...</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.034700</td>\n",
       "      <td>0.034724</td>\n",
       "      <td>0.001206</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>52:08.4</td>\n",
       "      <td>1076472</td>\n",
       "      <td>0.03821</td>\n",
       "      <td>0.03587</td>\n",
       "      <td>0.001957</td>\n",
       "      <td>0.03821</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.035923</td>\n",
       "      <td>0.001290</td>\n",
       "      <td>...</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.035923</td>\n",
       "      <td>0.001290</td>\n",
       "      <td>-0.206082</td>\n",
       "      <td>NaN</td>\n",
       "      <td>[nan]</td>\n",
       "      <td>[nan]</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>52:08.5</td>\n",
       "      <td>1108476</td>\n",
       "      <td>0.03703</td>\n",
       "      <td>0.03616</td>\n",
       "      <td>0.001768</td>\n",
       "      <td>0.03821</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.036505</td>\n",
       "      <td>0.036203</td>\n",
       "      <td>0.001311</td>\n",
       "      <td>...</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.036505</td>\n",
       "      <td>0.036203</td>\n",
       "      <td>0.001311</td>\n",
       "      <td>-0.886037</td>\n",
       "      <td>0.824385</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>52:08.5</td>\n",
       "      <td>1140476</td>\n",
       "      <td>0.03831</td>\n",
       "      <td>0.03659</td>\n",
       "      <td>0.001800</td>\n",
       "      <td>0.03831</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.037030</td>\n",
       "      <td>0.036634</td>\n",
       "      <td>0.001342</td>\n",
       "      <td>...</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.037030</td>\n",
       "      <td>0.036634</td>\n",
       "      <td>0.001342</td>\n",
       "      <td>-1.158537</td>\n",
       "      <td>0.903630</td>\n",
       "      <td>[nan]</td>\n",
       "      <td>[nan]</td>\n",
       "      <td>0.002122</td>\n",
       "      <td>0.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 55 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      time       us      acc    avg32     std32    max32    min32     med32  \\\n",
       "0  52:08.4  1012464  0.03598  0.03598  0.000000  0.03598  0.03598  0.035980   \n",
       "1  52:08.4  1044468  0.03342  0.03470  0.001280  0.03598  0.03342  0.034700   \n",
       "2  52:08.4  1076472  0.03821  0.03587  0.001957  0.03821  0.03342  0.035980   \n",
       "3  52:08.5  1108476  0.03703  0.03616  0.001768  0.03821  0.03342  0.036505   \n",
       "4  52:08.5  1140476  0.03831  0.03659  0.001800  0.03831  0.03342  0.037030   \n",
       "\n",
       "      rms32    engy32  ...    min8f     med8f     rms8f    engy8f     skw8f  \\\n",
       "0  0.035980  0.001295  ...  0.03598  0.035980  0.035980  0.001295       NaN   \n",
       "1  0.034724  0.001206  ...  0.03342  0.034700  0.034724  0.001206       NaN   \n",
       "2  0.035923  0.001290  ...  0.03342  0.035980  0.035923  0.001290 -0.206082   \n",
       "3  0.036203  0.001311  ...  0.03342  0.036505  0.036203  0.001311 -0.886037   \n",
       "4  0.036634  0.001342  ...  0.03342  0.037030  0.036634  0.001342 -1.158537   \n",
       "\n",
       "      krt8f  Fskw8f  Fkrt8f    Fmax8f  FmaxId8f  \n",
       "0       NaN     NaN     NaN       NaN       NaN  \n",
       "1       NaN     NaN     NaN       NaN       NaN  \n",
       "2       NaN   [nan]   [nan]  0.000000       0.0  \n",
       "3  0.824385     NaN     NaN       NaN       NaN  \n",
       "4  0.903630   [nan]   [nan]  0.002122       0.5  \n",
       "\n",
       "[5 rows x 55 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "csv_filename = \"printer_featured.csv\"\n",
    "csv_filename_pca = \"printer_featured_pca.csv\"\n",
    "df = pd.read_csv(csv_filename)\n",
    "df.head(5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3. 处理文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.02645402,  0.00555427],\n",
       "       [-0.02527457,  0.00300357],\n",
       "       [-0.02306549,  0.00382474],\n",
       "       ...,\n",
       "       [-0.02041657,  0.00506812],\n",
       "       [-0.02041035,  0.00506122],\n",
       "       [-0.0204128 ,  0.00505957]])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"\"\"\n",
    "n_components:\n",
    "意义：PCA算法中所要保留的主成分个数n，也即保留下来的特征个数n\n",
    "类型：int 或者 string，缺省时默认为None，所有成分被保留。\n",
    "赋值为int，比如n_components=1，将把原始数据降到一个维度。\n",
    "赋值为string，比如n_components='mle'，将自动选取特征个数n，使得满足所要求的方差百分比。\n",
    "\n",
    "copy:\n",
    "类型：bool，True或者False，缺省时默认为True。\n",
    "意义：表示是否在运行算法时，将原始训练数据复制一份。若为True，则运行PCA算法后，原始训练数据的值不会有任何改变，因为是在原始数据的副本上进行运算；若为False，则运行PCA算法后，原始训练数据的 值会改，因为是在原始数据上进行降维计算。\n",
    "\n",
    "whiten:\n",
    "类型：bool，缺省时默认为False\n",
    "意义：白化，使得每个特征具有相同的方差。\n",
    "\n",
    "components_：返回具有最大方差的成分。\n",
    "explained_variance_ratio_：返回 所保留的n个成分各自的方差百分比。\n",
    "n_components_：返回所保留的成分个数n。\n",
    "\"\"\"\n",
    "\n",
    "pca=PCA(n_components=2)     #加载PCA算法，设置降维后主成分数目为2\n",
    "X = df[['avg32','std32',\"max32\",\"min32\"]]  #选择表格中的'w'、'z'列\n",
    "reduced_X=pca.fit_transform(X)#对样本进行降维\n",
    "pca.components_\n",
    "pca.explained_variance_ratio_\n",
    "pca.n_components_\n",
    "reduced_X"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4. 可视化"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 查看PCA的成分比例"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1649c875c88>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAKWUlEQVR4nO3dUaif913H8c93CdUL5y7M8SZJl4KZGKZQDFXYhZNNSHeR3AxJYahQlqu6i41BRakSr1yFXUUw4JgOXI270CCRXGhFkXUkZTpNSyBEXQ+9aDbrQERr4OtFTsfp6UnOk/pPT/PN6wWB//M8P57zJRzePHlOnudUdweA+9/7dnsAAFZD0AGGEHSAIQQdYAhBBxhi72594X379vWhQ4d268sD3JdefPHF73T32nbHdi3ohw4dyuXLl3frywPcl6rq3253zC0XgCEEHWAIQQcYQtABhhB0gCEEHWAIQQcYQtABhhB0gCF27UnRVfjpz//Rbo/Ae9CLz/7Sbo8Au8IVOsAQgg4whKADDCHoAEMIOsAQgg4whKADDCHoAEMIOsAQgg4whKADDCHoAEMIOsAQgg4whKADDCHoAEMIOsAQgg4whKADDCHoAEMsCnpVHauqq1V1raqe3ub4w1X1fFV9s6q+VVWfWP2oANzJjkGvqj1JziR5PMmRJE9U1ZEty34jybnufjTJySS/t+pBAbizJVfojyW51t3Xu/uNJM8lObFlTSf54Y3PH0jy6upGBGCJJUHfn+SVTdvrG/s2+60kn6qq9SQXkvzqdieqqlNVdbmqLt+4ceMdjAvA7SwJem2zr7dsP5Hky919IMknknylqt527u4+291Hu/vo2tra3U8LwG0tCfp6koObtg/k7bdUnkxyLkm6++tJfjDJvlUMCMAyS4J+Kcnhqnqkqh7KrR96nt+y5ttJPpYkVfUTuRV091QA3kU7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nm9u38syReT/M6qBwXgzpZcoT+W5Fp3X+/uN5I8l+TEljUnkvzhxuevJflYVdXqxgRgJ0t+SfT+JK9s2l5P8jO3W9PdN6vqe0l+JMl3Ni+qqlNJTm1s/mdVXX0nQ7Otfdny9/2gqt/95d0egbfyvfmm31zJde4Hb3dgSdC3m6DfwZp099kkZxd8Te5SVV3u7qO7PQds5Xvz3bPklst6koObtg8kefV2a6pqb5IPJPn3VQwIwDJLgn4pyeGqeqSqHkpyMsn5LWvOJ3nz37mfTPLX3f22K3QA7p0db7ls3BN/KsnFJHuSfKm7r1TV6SSXu/t8kj9I8pWqupZbV+Yn7+XQbMutLN6rfG++S8qFNMAMnhQFGELQAYYQ9PvcTq9lgN1SVV+qqteq6p93e5YHhaDfxxa+lgF2y5eTHNvtIR4kgn5/W/JaBtgV3f238TzKu0rQ72/bvZZh/y7NAuwyQb+/LXrlAvBgEPT725LXMgAPCEG/vy15LQPwgBD0+1h330zy5msZXk5yrruv7O5UcEtVfTXJ15P8eFWtV9WTuz3TdB79BxjCFTrAEIIOMISgAwwh6ABDCDrAEIIOMISgAwzxf1/tFRagvH2MAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.barplot(x=np.array(range(pca.n_components_)),y=pca.explained_variance_ratio_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 把PCA结果的前两列绘制出来"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1649c8b0668>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAD4CAYAAAAZ1BptAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAA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E78ZASwF/gsTF7f+Anhrz9zPdfMeB963UGoDPgg81v2P+RDwgXl67H6Hid+oXgaOAo/1zP2XXd2HgH+xkOoD/gHwSPf4PQLcME/13Qc8Cxzotp0L7PHrW98Cevz+oHseHAC+R8+L9Kl+7g5S3+l6/laV/yyHJKnNaxKSpCZDQpLUZEhIkpoMCUlSkyEhSWoyJCRJTYaEJKnp/wPjZIcmvKn+PAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.kdeplot(reduced_X[:,0],reduced_X[:,1],shade=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5. 把PCA[0]和PCA[1]赋值到CSV文件里"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "df[\"pca0\"] = reduced_X[:,0]\n",
    "df[\"pca1\"] = reduced_X[:,1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4. 保存文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "## index=0,去掉索引列\n",
    "df.to_csv(csv_filename_pca,float_format='%.6f',index=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>us</th>\n",
       "      <th>acc</th>\n",
       "      <th>avg32</th>\n",
       "      <th>std32</th>\n",
       "      <th>max32</th>\n",
       "      <th>min32</th>\n",
       "      <th>med32</th>\n",
       "      <th>rms32</th>\n",
       "      <th>engy32</th>\n",
       "      <th>...</th>\n",
       "      <th>rms8f</th>\n",
       "      <th>engy8f</th>\n",
       "      <th>skw8f</th>\n",
       "      <th>krt8f</th>\n",
       "      <th>Fskw8f</th>\n",
       "      <th>Fkrt8f</th>\n",
       "      <th>Fmax8f</th>\n",
       "      <th>FmaxId8f</th>\n",
       "      <th>pca0</th>\n",
       "      <th>pca1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>52:08.4</td>\n",
       "      <td>1012464</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.001295</td>\n",
       "      <td>...</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.001295</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.026454</td>\n",
       "      <td>0.005554</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>52:08.4</td>\n",
       "      <td>1044468</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.03470</td>\n",
       "      <td>0.001280</td>\n",
       "      <td>0.03598</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.034700</td>\n",
       "      <td>0.034724</td>\n",
       "      <td>0.001206</td>\n",
       "      <td>...</td>\n",
       "      <td>0.034724</td>\n",
       "      <td>0.001206</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.025275</td>\n",
       "      <td>0.003004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>52:08.4</td>\n",
       "      <td>1076472</td>\n",
       "      <td>0.03821</td>\n",
       "      <td>0.03587</td>\n",
       "      <td>0.001957</td>\n",
       "      <td>0.03821</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.035980</td>\n",
       "      <td>0.035923</td>\n",
       "      <td>0.001290</td>\n",
       "      <td>...</td>\n",
       "      <td>0.035923</td>\n",
       "      <td>0.001290</td>\n",
       "      <td>-0.206082</td>\n",
       "      <td>NaN</td>\n",
       "      <td>[nan]</td>\n",
       "      <td>[nan]</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.023065</td>\n",
       "      <td>0.003825</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>52:08.5</td>\n",
       "      <td>1108476</td>\n",
       "      <td>0.03703</td>\n",
       "      <td>0.03616</td>\n",
       "      <td>0.001768</td>\n",
       "      <td>0.03821</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.036505</td>\n",
       "      <td>0.036203</td>\n",
       "      <td>0.001311</td>\n",
       "      <td>...</td>\n",
       "      <td>0.036203</td>\n",
       "      <td>0.001311</td>\n",
       "      <td>-0.886037</td>\n",
       "      <td>0.824385</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.023099</td>\n",
       "      <td>0.003864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>52:08.5</td>\n",
       "      <td>1140476</td>\n",
       "      <td>0.03831</td>\n",
       "      <td>0.03659</td>\n",
       "      <td>0.001800</td>\n",
       "      <td>0.03831</td>\n",
       "      <td>0.03342</td>\n",
       "      <td>0.037030</td>\n",
       "      <td>0.036634</td>\n",
       "      <td>0.001342</td>\n",
       "      <td>...</td>\n",
       "      <td>0.036634</td>\n",
       "      <td>0.001342</td>\n",
       "      <td>-1.158537</td>\n",
       "      <td>0.903630</td>\n",
       "      <td>[nan]</td>\n",
       "      <td>[nan]</td>\n",
       "      <td>0.002122</td>\n",
       "      <td>0.5</td>\n",
       "      <td>-0.022986</td>\n",
       "      <td>0.003912</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 57 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      time       us      acc    avg32     std32    max32    min32     med32  \\\n",
       "0  52:08.4  1012464  0.03598  0.03598  0.000000  0.03598  0.03598  0.035980   \n",
       "1  52:08.4  1044468  0.03342  0.03470  0.001280  0.03598  0.03342  0.034700   \n",
       "2  52:08.4  1076472  0.03821  0.03587  0.001957  0.03821  0.03342  0.035980   \n",
       "3  52:08.5  1108476  0.03703  0.03616  0.001768  0.03821  0.03342  0.036505   \n",
       "4  52:08.5  1140476  0.03831  0.03659  0.001800  0.03831  0.03342  0.037030   \n",
       "\n",
       "      rms32    engy32  ...     rms8f    engy8f     skw8f     krt8f  Fskw8f  \\\n",
       "0  0.035980  0.001295  ...  0.035980  0.001295       NaN       NaN     NaN   \n",
       "1  0.034724  0.001206  ...  0.034724  0.001206       NaN       NaN     NaN   \n",
       "2  0.035923  0.001290  ...  0.035923  0.001290 -0.206082       NaN   [nan]   \n",
       "3  0.036203  0.001311  ...  0.036203  0.001311 -0.886037  0.824385     NaN   \n",
       "4  0.036634  0.001342  ...  0.036634  0.001342 -1.158537  0.903630   [nan]   \n",
       "\n",
       "   Fkrt8f    Fmax8f  FmaxId8f      pca0      pca1  \n",
       "0     NaN       NaN       NaN -0.026454  0.005554  \n",
       "1     NaN       NaN       NaN -0.025275  0.003004  \n",
       "2   [nan]  0.000000       0.0 -0.023065  0.003825  \n",
       "3     NaN       NaN       NaN -0.023099  0.003864  \n",
       "4   [nan]  0.002122       0.5 -0.022986  0.003912  \n",
       "\n",
       "[5 rows x 57 columns]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
